Open
Conversation
- Allow opening URLs containing special chars, like quote characters - Selections must be strict, without surrounding whitespace
inkarkat
added a commit
to inkarkat/tmux-open
that referenced
this pull request
May 24, 2023
Filespec(s, on individual lines) need to be shell-quoted, as they are passed (through xargs) to the opener. For the editor (which cannot simply be launched but needs to use the actual terminal so that the editor will be launched inside and therefore visible inside the pane), it's even worse: The concluding CR is only appended once, not for each file. Files should not be edited separately, anyway, but passed as multiple argments to a single editor instance. Also, the editor call itself should disable name lookup (send-keys -l) so that filenames that resemble a Tmux key aren't accidentally translated into a keypress. Inspired by tmux-plugins#38 (which provides a bad solution, though).
inkarkat
added a commit
to inkarkat/tmux-open
that referenced
this pull request
May 26, 2023
Filespec(s, on individual lines) need to be shell-quoted, as they are passed (through xargs) to the opener. We need to use null-termination so that xargs doesn't do special handling of quotes. -I (implying -L 1) is _not_ enough! As our input is newline-delimited, use tr to translate to null separators, then feed to xargs -0. For the editor (which cannot simply be launched but needs to use the actual terminal so that the editor will be launched inside and therefore visible inside the pane), it's even worse: The concluding CR is only appended once, not for each file. Files should not be edited separately, anyway, but passed as multiple argments to a single editor instance. Also, the editor call itself should disable name lookup (send-keys -l) so that filenames that resemble a Tmux key aren't accidentally translated into a keypress. Inspired by tmux-plugins#38 (which provides a bad solution, though).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This solves one of the issues I've commented at:
Associated tmux-copycat pull request: tmux-plugins/tmux-copycat#135